/**
 * 中国9号健康产业有限公司
 * Copyright (C) JiuHaoHealth Corporation. All Rights Reserved
 */
package com.jiuhaohealth.common.datasource;
/**
 * @author minghui(jackchenmh@gmail.com)
 * @version 2014-3-18 下午5:08:45
 */
public class CommunityThreadLocal {

	 private final static ThreadLocal<String> dataSourceKeyHolder = new ThreadLocal<String>();

	 public static void chooseDateSource(DataSourceChooser chooser){
		   dataSourceKeyHolder.set(chooser.choose());
	 }
	 
	 public static void setDataSourceKey(String key){
		   dataSourceKeyHolder.set(key);
	 }
	   
	 public static String getDataSourceKey(){
		   return dataSourceKeyHolder.get();
	 }
	 
	 public static void removeDataSourceKey(){
		   dataSourceKeyHolder.remove();
	 }
}
